<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserBrokerageFrozensTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_brokerage_frozens', function (Blueprint $table) {
            $table->id()->comment('用户金额冻结记录表');
            $table->integer('user_id')->comment('用户id')->index();
            $table->decimal('price',10,2)->comment('冻结金额');
            $table->integer('uill_id')->comment('关联id');
            $table->timestamp('frozen_time')->comment('冻结到期时间');
            $table->integer('order_id')->comment('相关订单id')->index();
            $table->integer('status')->default(1)->comment('是否有效 0:无效 1:有效')->index();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_brokerage_frozens');
    }
}
